FROM kernelstudio/cuda-liboffice-runtime:latest

ENV VIRTUAL_ENV=/app/.venv
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"

WORKDIR /app

COPY ./requirements.txt /app

RUN python3 -m venv .venv && \
    mkdir -p /root/.paddlex/fonts/ && \
    wget https://paddle-model-ecology.bj.bcebos.com/paddlex/PaddleX3.0/fonts/PingFang-SC-Regular.ttf -O /root/.paddlex/fonts/PingFang-SC-Regular.ttf && \
    wget https://paddle-model-ecology.bj.bcebos.com/paddlex/PaddleX3.0/fonts/simfang.ttf -O /root/.paddlex/fonts/simfang.ttf && \
    pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt

# 清理
RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/* \
    rm -rf /tmp/* \
    rm -rf /root/.cache/pip

CMD ["/bin/sh"]